/**
 * @ingroup     core
 * @{
 *
 * @file
 * @brief       Debug-header
 *
 */

#ifndef DEBUG_H
#define DEBUG_H

#include <stdio.h>

#ifdef __cplusplus
extern "C" {
#endif

/**
 * @def DEBUG_PRINT
 */

#define DEBUG_PRINT(...) printf(__VA_ARGS__)

/**
 * @name Debugging defines
 * @{
 */
/**
 * @brief   This macro can be defined as 0 or other on a file-based level.
 *          @ref DEBUG() will generate output only if ENABLE_DEBUG is non-zero.
 */
#if !defined(ENABLE_DEBUG)
#define ENABLE_DEBUG 0
#endif

/**
 * @def DEBUG
 *
 * @brief Print debug information to stdout
 *
 * @note Another name for ::DEBUG_PRINT
 */
#define DEBUG(...) do { if (ENABLE_DEBUG) { DEBUG_PRINT(__VA_ARGS__); } } while (0)

#ifdef __cplusplus
}
#endif

#endif /* DEBUG_H */
/** @} */
